//
//  HTMLString.m
//  lvfj
//
//  Created by lvfeijun on 2022/6/1.
//  Copyright © 2022 Goudu KuaiEx Technology(Shenzhen)Co.,ltd. All rights reserved.
//

#import "HTMLString.h"

@implementation HTMLString
///有边框
- (NSString *)getHTMLString:(NSString *)contentHtml
{
    return [NSString stringWithFormat:@"<html><head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0\" /><style>img {max-width: 100%% ;height: auto;} \ntable {max-width: 100%% ;height: auto;} \nbody {font-size:13;color:#444444}</style></head><body>%@</body></html>", contentHtml];
}
/**
 *{margin:0;padding:0;}
 */
///无边框
- (NSString *)getHTMLString:(NSString *)contentHtml
{
    return [NSString stringWithFormat:@"<html><head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0\" /><style>img {width: 100%%!important;height: auto!important;display: block!important;} \n *{margin:0;padding:0;}  \ntable {max-width: 100%% ;height: auto;} \nbody{font-size:13;color:#444444}</style></head><body>%@</body></html>", contentHtml];
}

///图片默认用www.jianzhuj.cn域名
+ (NSString *)hqar_getHTMLString:(NSString *)string
{
    if ([NSString hq_isEmptyString:string]) {
        return @"";
    }
    
    NSString *str0 = [NSString stringWithFormat:@"<html><head><meta name=\"viewport\" content=\"width=%f,initial-scale=1.0,maximum-scale=1.0,user-scalable=0\" />\n<link type=\"text/css\" href=\"https://oss-hqwx-edu24ol.oss-cn-beijing.aliyuncs.com/jianzhujie/css/article.reset.css\" rel=\"stylesheet\"><style>\n * {max-width:%f !important;height:auto;}\n </style>\n<base href=\"https://www.jianzhuj.cn\"></head>\n<body>",kScreen_Width - 32,kScreen_Width - 40];
    NSString *str1 = @"</body>\n</html>";
    return [NSString stringWithFormat:@"%@%@%@",str0,string,str1];
}
@end
